feat: Add support for TRANSFER_IN and TRANSFER_OUT events#308
feat: Add support for TRANSFER_IN and TRANSFER_OUT events#308MedAzizKhayati wants to merge 3 commits into
Conversation
|
Hi, looks like a sensible addition/fix. Is there something wrong with the PR? |
|
hi, why has this addition not made it to the main branch? It would be very useful to have "transfer in" and "transfer out" events included in the transactions export. |
Feel free to merge that, must have closed it by mistake. |
|
It has conflicts with current main branch. Would you mind resolving that? |
8a97f7c to
0efbe4e
Compare
Resolved |
There was a problem hiding this comment.
Pull request overview
Adds parsing support for securities transfer timeline events so they can be exported as Portfolio Performance transfer transactions.
Changes:
- Maps transfer-related subtitles to
TRANSFER_IN/TRANSFER_OUT. - Adds ISIN/share parsing helpers for transfer events and cancellation handling from header status.
- Adds transfer fixtures and expected transaction-export cases.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pytr/event.py |
Adds transfer event classification and parsing logic. |
pytr/locale/de/LC_MESSAGES/messages.po |
Updates German labels for transfer transaction types. |
tests/test_events.py |
Adds expected parsing/export assertions for transfer events. |
tests/transfer_in.json |
Adds inbound transfer fixture. |
tests/transfer_out.json |
Adds outbound transfer fixture. |
tests/transfer_out_cancelled.json |
Adds cancelled outbound transfer fixture. |
tests/wertpapiertransfer_in.json |
Adds legacy-style inbound securities transfer fixture. |
tests/wertpapiertransfer_out.json |
Adds legacy-style outbound securities transfer fixture. |
Comments suppressed due to low confidence (2)
pytr/event.py:546
- Supporting transfers here also makes them go through the earlier fee-parsing warning path, but
TRANSFER_IN/TRANSFER_OUTare not excluded from the “Could not parse fees” check. As a result, normal transfer events without aGebührfield will emit a misleading warning before being parsed successfully.
elif event_type in [PPEventType.TRANSFER_IN, PPEventType.TRANSFER_OUT]:
isin = cls._parse_isin(event_dict)
shares = cls._parse_transfer_shares(event_dict)
value = 0 # Transfers have no monetary value
pytr/event.py:828
Anteileis a German field label, but this path parses it with English locale preference. Values that are valid in both locales, such as1.234, will be interpreted as 1.234 shares instead of the German thousands value 1234, unlike the existing share parser which only uses the English preference forAktien/Shareslabels.
if item.get("title") in ["Aktien", "Shares", "Anteile"]:
return cls._parse_float_from_text_value(item.get("detail", {}).get("text", ""), {}, "en")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #276
Description
This is my attempt to finally support TRANSFER_IN and TRANSFER_OUT events which were not mapped in the past.
These are the following actual events that are supported in this MR: